set infoMember to the memberNum of sprite infoSprite
set infoName to the name of member infoMember
put infoName into field "info"
end
on mouseEnter me
if toggled = 0 then
set the member of sprite the spriteNum of me to the alternateImage of me
else
set the member of sprite the spriteNum of me to the toggleImage of me
end if
end
on mouseUp me
if toggled = 0 then
set the member of sprite the spriteNum of me to the toggleImage of me
set toggled to 1
else
set the member of sprite the spriteNum of me to the alternateImage of me
set toggled to 0
end if
puppetSound("spanx")
updateStage()
setMovieLoop()
end
on mouseLeave me
if toggled = 1 then
set the member of sprite the spriteNum of me to the toggleOffImage of me
else
set the member of sprite the spriteNum of me to the standardImage of me
end if
put EMPTY into field "info"
end
on setMovieLoop
if toggled = 1 then
set the loop of member "MovieMember1" to 1
set the loop of member "MovieMember2" to 1
if movieSprite(52) then
set the movieRate of sprite 52 to 1
end if
set the member of sprite 58 to "pause off"
killAutoRepeat()
else
set the loop of member "MovieMember1" to 0
set the loop of member "MovieMember2" to 0
end if
end
on beginSprite me
set the standardImage of me to the member of sprite the spriteNum of me
set toggled to 0
set memref to the member of sprite the currentSpriteNum
set castLibNum to the castLibNum of memref
set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
set alternateImage to memdefault
set toggleImage to member "straight on"
set toggleOffImage to member "straight off"
end
on getBehaviorDescription
return "Change the sprite's cast member when the mouse rolls over the current sprite and toggles image on mouseDown." & RETURN & "To set up you toggle button you will need 4 button states placed in the cast in this order:" & RETURN & " normal state" & RETURN & " mouseOver state" & RETURN & " mouseOver and toggled state" & RETURN & " toggled normal" & RETURN & "PARAMETERS:" & RETURN & "ΓÇó Use Next Member - Turn this option on to automatically display the next cast member in the cast when mouse rolls over the sprite." & RETURN & "ΓÇó Rollover Cast Member - Choose a specific cast member to appear when the mouse rolls over the sprite. This setting is ignored if Use Next Member is on." & RETURN & "ΓÇó Toggled Cast Member(on) - Use this option to select the toggled image when the mouse is still over it." & RETURN & "ΓÇó Toggled Cast Member(off) - Use this option to select the toggled image when the mouse is rolled of it."